<%@page contentType="text/html; charset=UTF-8" session="false" %>
<%@include  file="/WEB-INF/jspf/import.jspf"%>
<div class="pageHeader">
    <form onsubmit="return navTabSearch(this);" id="pagerForm" name="searchForm" method="post">
        <input type="hidden" name="pageNum" value="${pager.pageNo}" />
        <input type="hidden" name="pageSize" value="${pager.pageSize}" />
        <input type="hidden" name="orderField" value="${orderField}" />
        <input type="hidden" name="orderDirection" value="${orderDirection}" />
        <div class="searchBar">
            <table class="searchContent">
                <tbody>
                    <tr>
                        <td><label>用户ID：</label><input type="text" name="userId" value="${param.userId}" class="textInput"></td>
                        <td><label>用户名：</label><input type="text" name="userName" value="${param.userName}" class="textInput"></td>
                    </tr>
                </tbody>
            </table>
            <div class="subBar">
                <ul>
                    <li><div class="buttonActive"><div class="buttonContent"><button type="button" onclick="listBatchExport();">导出excel</button></div></div></li>
                    <li><div class="buttonActive"><div class="buttonContent"><button type="submit">查询</button></div></div></li>
                </ul>
            </div>
        </div>
    </form>
</div>
<div class="pageContent">
    <table class="table" style="width: 100%" layoutH="110">
        <thead>
            <tr>
                <th >用户ID</th>
                <th >用户名</th>
                <th >创建时间</th>
                <th >用户昵称</th>
                <th >真实姓名</th>
                <th >性别</th>
                <th >地址</th>
                <th >电话</th>
                <th >是否认证</th>
                <th orderField="joined_club_count" class="${orderField=='joined_club_count' ? orderDirection : ''}">已加入车友会</th>
                <th >生日</th>
                <th >操作</th>
            </tr>
        </thead>
        <tbody>
            <c:forEach var="user" items="${pager.resultList}">
                <tr>
                    <td>${user.uid }</td>
                    <td>${fn:escapeXml(user.username) }</td>
                    <td><fmt:formatDate value="${user.createAt }" pattern="yyyy-MM-dd"/></td>
                    <td>${fn:escapeXml(user.nickname) }</td>
                    <td>${fn:escapeXml(user.truename) }</td>
                    <td>
	                    <c:if test="${user.gender==0}">男</c:if>
	                    <c:if test="${user.gender==1}">女</c:if>
                    </td>
                    <td>${fn:escapeXml(user.province) }&nbsp;&nbsp;${fn:escapeXml(user.city) }</td>
                    <td>${fn:escapeXml(user.phone) }</td>
                    <td>
                    	<c:if test="${user.vip==0}">否</c:if>
	                    <c:if test="${user.vip==1}">是</c:if>
                    </td>
                    <td>${user.joinedClubCount }</td>
                    <td><fmt:formatDate value="${user.birthday }" pattern="yyyy-MM-dd"/></td>
                    <td>
                    	<a class="btnEdit" href="${ROOT}/admin/account/detail.do?userId=${user.uid}"
	                         target="navTab" rel="account-detail" title="查看详细信息">查看详细信息</a>
                    </td>
                </tr>
            </c:forEach>
        </tbody>
    </table>
</div>
<div class="panelBar">
    <div class="pages">
        <span>共 ${pager.total} 条</span>
    </div>
    <div class="pagination" targetType="navTab" totalCount="${pager.total}" numPerPage="${pager.pageSize}" pageNumShown="10" currentPage="${pager.pageNo}"></div>
</div>
<script>
    var userId = "${param.userId}";
    var userName = "${param.userName}";
    var orderField = "${orderField}";
    var orderDirection = "${orderDirection}";
function listBatchExport(){
    location.href="${ROOT}/admin/account/listBatchExport.do?userId="+userId+"&userName="+userName+"&orderField="+orderField+"&orderDirection="+orderDirection;
}    
</script>